<?php 
class nextPartAction extends AjaxAction{
	private $data = array();
	public function execute($request){
		$this->data['pagination']	= array(
				'page'		=> $request->getParameter('page', 1),
				'limit'		=> $request->getParameter('limit', sfConfig::get('app_news_next_limit')),
				'page_show'	=> sfConfig::get('app_news_page_show')
		);
		$this->data['id']	= $request->getParameter('id',1 );
		
		$this->data['news_cate']	= NewsCatesTable::getDataById(intval($request->getParameter('cate_id',-1)));
		$data_filter = array('ids_notin'=>array($this->data['id']),'cate_id'=>$request->getParameter('cate_id',-1));
		$this->data['news']			= NewsTable::getDataListFrontend($data_filter,$this->data['pagination']['page'],$this->data['pagination']['limit']);
		$this->data['news_total']	= NewsTable::getDataListFrontendCount($data_filter);
		
		
		$pag	= new PaginationHelper($this->data['news_total'], $this->data['pagination']['limit'], $this->data['pagination']['page_show'], $this->data['pagination']['page'], 'news_part');
		$this->data['pagination_pager']	= $pag->getPaginations();
		
		return $this->renderPartial('nextPart', array('data' => $this->data));
	}
}